<template>
  <tr>
    <th>
      <input type="checkbox" v-model="obj.checked" />
    </th>
    <th>{{obj.name}}</th>
    <th>{{obj.price}}</th>
    <th> <button @click="elbtn(index)">-</button> {{obj.num}} <button @click="addbtn(index)">+</button></th>
    <th>{{obj.price * obj.num}}</th>
    <th>
      <button @click="shan(index)">删除</button>
    </th>
  </tr>

</template>

<script>
  export default {
    props: ['obj', 'index'],
    methods: {
      addbtn(index) {
        this.$emit('adds', index)
      },
      elbtn(index) {
        this.$emit('els', index)
      },
      shan(index) {
        this.$emit('shanchu', index)
      }
    }

  }
</script>

<style>

</style>